import 'package:flutter/material.dart';
// import 'package:get/get.dart';

class AppTheme {
  static ThemeData get light => ThemeData(
        brightness: Brightness.light,
        // 头部栏
        appBarTheme: const AppBarTheme(
          // backgroundColor: Color(0xFFf43f3b),
          backgroundColor: Colors.white,
          // foregroundColor: Colors.red,
          // 页面滚动到appbar后的背景颜色
          surfaceTintColor: Colors.white,
        ),
        // Scaffold背景颜色
        scaffoldBackgroundColor: Colors.white,
        // 底部栏
        bottomNavigationBarTheme: const BottomNavigationBarThemeData(
          selectedItemColor: Color(0xFFf43f3b),
          selectedIconTheme: IconThemeData(color: Color(0xFFf43f3b)),
          unselectedItemColor: Colors.grey,
          backgroundColor: Colors.white,
          selectedLabelStyle: TextStyle(fontWeight: FontWeight.bold),
          unselectedLabelStyle: TextStyle(color: Color(0xFF9E9E9E)),
        ),
        // switch
        switchTheme: SwitchThemeData(
          thumbColor: MaterialStateProperty.resolveWith(
            (states) {
              if (states.contains(MaterialState.selected)) {
                return const Color(0xFFf43f3b); // 滑块颜色（选中）
              }
              return Colors.grey; // 滑块颜色（未选中）
            },
          ),
          trackColor: MaterialStateProperty.resolveWith(
            (states) {
              if (states.contains(MaterialState.selected)) {
                return const Color(0xFFf43f3b).withOpacity(0.5); // 滑轨颜色（选中）
              }
              return Colors.grey.withOpacity(0.5); // 滑轨颜色（未选中）
            },
          ),
        ),
        // slider
        sliderTheme: const SliderThemeData(
          // 活动部分的颜色（已滑过的进度条颜色）
          activeTrackColor: Color(0xFFf43f3b),
          // 非活动部分的颜色（未滑过的进度条颜色）
          // inactiveTrackColor: Color(0xFFF9F9F9),
          // 滑块（圆圈）的颜色
          thumbColor: Color(0xFFf43f3b),
        ),
        // 全局去除点击事情的水波纹效果
        splashColor: Colors.transparent,
        highlightColor: Colors.transparent,
        hoverColor: Colors.transparent,
      );

  static ThemeData get dark => ThemeData(
        brightness: Brightness.dark,
        // 头部栏
        appBarTheme: const AppBarTheme(
          backgroundColor: Color(0xFFf43f3b),
          foregroundColor: Colors.white,
        ),
      );
}
